{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>收货地址</title>
    <link rel="stylesheet" type="text/css" href="{% static 'stylesheets/redeem_shipping.css' %}"/>
    <link rel="stylesheet" type="text/css" href="{% static 'stylesheets/common.css' %}"/>
    <link rel="icon" href="{% static 'images/favicon.ico' %}"/>
</head>
<body>
<div class="page flex-col justify-between">
    <div class="box_container flex-col">
        <div class="box_navigation flex-col">
            <div class="menu-wrapper flex-row justify-between">
                <a class="text_menu" href="{% url 'all_history' %}">抽奖记录</a>
                <a class="text_menu" href="{% url 'redemptions' %}">中奖记录</a>
                <a class="text_menu active">收货地址</a>
            </div>
        </div>
        {% if shipping_list.count > 0 %}
        <div class="box_shipping flex-col">
            {% for item in shipping_list %}
            <div class="box_shipping_list flex-col">
                <div class="box_shipping_item">
                    <div class="shipping_infos">
                        <span class="shipping_name">收件姓名:</span>
                        <span class="shipping_title">{{ item.nick_name }}</span>
                    </div>
                    <div class="shipping_infos">
                        <span class="shipping_name">联系方式:</span>
                        <span class="shipping_title">{{ item.mobile }}</span>
                    </div>
                    <div class="shipping_infos">
                        <span class="shipping_name">详细地址:</span>
                        <span class="shipping_address">{{ item.full_address }}</span>
                    </div>
                    {% if item.is_default %}
                        <div class="default-marker"></div>
                        <div class="default-text">默认地址</div>
                    {% endif %}
                </div>
                <div class="shipping_actions">
                    {% if not item.is_default %}
                    <a style="color: #e8962e;text-decoration: none;"
                           href="/set_default_shipping?shipping_id={{ item.id }}">设为默认地址</a>
                    {% endif %}
                    <a style="color: #993333;text-decoration: none;"
                       href="/delete_shipping?shipping_id={{ item.id }}">删除</a>
                </div>
            </div>
            {% endfor %}
        </div>
        {% else %}
        <div class="no_redemption flex-col">
            <img class="no_img" src="{% static 'images/blank_redemptions.png' %}"/>
            <span>暂无收货地址</span>
        </div>
        </div>
        {% endif %}
        <div class="hidden-div"></div>
        <div class="box_add_shipping">
          <div class="text-wrapper_7">
            <a class="text_16" href="/shipping/new">填写收货地址</a>
          </div>
        </div>
    </div>
<script src="{% static 'javascript/jquery-3.6.0.js' %}"></script>
</body>
</html>
